home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-07 | 630 b | 11 lines | [TEXT/ToyS] |
- set x to (("9776.552" as real) as string) -- string to real to string
- -- the previous line shows how the number changes as it is coerced to a real
- set y to "9776.552" -- this is the original string
- 9776.552 -- watch this when you compile it! It no longer is 9776.552
- -- the following displays values in the result window
- -- x is the converted string, y is the original string
- -- x = y is a string comparision, while the next one is a pair of reals
- -- Finally, an example of how two numbers which don't suffer from round off
- -- can equal one that does
- {x, y, x = y, (x as real) = (y as real), 76.552 + 9700 = 9776.5519999999997}
-